#include "rclcpp/rclcpp.hpp"
#include <agv_msgs/msg/agv_state_test.hpp>

int main(int argc, char *argv[])
{
    setlocale(LC_ALL,"");
    rclcpp::init(argc, argv);
    auto nh = rclcpp::Node::make_shared("state_pub");
    auto pub = nh.advertise<agv_msgs::msg::AgvStateTest>("agv_state_pub",1000);

    int testdata;
    agv_msgs::msg::AgvStateTest state;
    
    rclcpp::Rate r(10);
    while (rclcpp::ok())
    {
        nh.param<int>("testdata", testdata, 0);
        state.agv_test_state = (uint64_t)testdata;
        pub.publish(state);
        r.sleep();
        rclcpp::spin_some(node);
    }

    return 0;
}
